import 'package:environmental_les_app/common/widgets/search_entry_widget.dart';
import 'package:flutter_clx_base/flutter_clx_base.dart';

import 'index.dart';
import 'widgets/build_file_item.dart';
import 'widgets/search_input_view.dart';

class KnowledgeLibraryPage extends GetView<KnowledgeLibraryController> {
  const KnowledgeLibraryPage({super.key});

  // 主视图
  Widget _buildView() {
    return Column(
      children: [
        InkWell(
            onTap: () => Get.to(() => const SearchInputView()),
            child: const SearchEntryWidget(hintText: "请输入要查询内容")),
        const BuildFileItem(),
        const BuildFileItem(),
        const BuildFileItem(),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<KnowledgeLibraryController>(
      init: KnowledgeLibraryController(),
      id: "knowledge_library",
      builder: (_) {
        return MyScaffold(
          title: '知识库',
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
